<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<%@ include file="/commons/validation.jsp" %>
<link href="${ctx}/styles/listTable.css" rel="stylesheet" type="text/css">
<link href="${ctx}/styles/show.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/global.js"></script>
<script type="text/javascript" src="${ctx}/scripts/public.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>
<%@ include file="/commons/dateTime.jsp" %>

<script type="text/javascript">
	/**
	 * 打开收费周期页面
	 */
   function showCycleForward(){
   		var url = "${ctx}/charge_chargeCycleForwardAction.do?method=chargeCycleForwardSmall";
		top.windowOpen(url, "chargeCycleForward", "", 340, 900);
   }
   /**
    *  收费周期跳转页面方法
    */
   function cycleForward(url){
   		window.location.href=url;
   }
/**************查询相关******************/
	//提交查询条件
	function mysubmit(){
		var flag = $("serchForm").fireEvent("onsubmit");
		if(!flag) return;
		var url = "${ctx}/charge_meterDataRegisterAction.do?method=setSearchVO";
		var param = $("serchForm").serialize();
		new Ajax.Request(url,{method: 'post', parameters: param, onComplete: reloadFrame});
	}
/*************业务操作有关*****************/
	/**
	 * 按户录入走表数据
	 */
	function openRecordByUser(){
		var url = "${ctx}/charge_meterDataRegisterAction.do?method=initByUser";
		top.windowOpen(url, "byUser", "${key.charge_meterData_byUser}", 355, 530,true,"byUserFrame");
	}
	/**
	 * 按水表录入数据
	 */
	function openRecordBySaterMeter(){
		var url = "${ctx}/charge_meterDataRegisterAction.do?method=initByWater";
		top.windowOpen(url, "byWater", "${key.charge_meterData_byWater}", 311, 450,true,"byWaterFrame");
	}
	/**
	 * 按电表录入数据
	 */
	function openRecordByAmmeter(){
		var url = "${ctx}/charge_meterDataRegisterAction.do?method=initByAmmeter";
		top.windowOpen(url, "byAmmeter", "${key.charge_meterData_byAmmeter}", 311, 450,true,"byAmmeterFrame");
	}
	/**
	 * 确认作废数据
	 */
	function openAbateMaterdata(){
		//先验证是否可以修改或者调整,然后设置文本框可以编辑
		var url = "${ctx}/charge_meterDataRegisterAction.do?method=validateAbateable";
		var params = "chargeDataId=" + window.frames("meterDataFrame").currentId;
		sendAjaxRequest(url,params,function(result){
			ajaxSubmitException(result.responseText);
			AskConfirm("${key.charge_meterData_Abate_confrim}","main","abateMeterData");
		});
	}
	/**
	 * 作废数据
	 */
	function abateMeterData(){
		var url = "${ctx}/charge_meterDataRegisterAction.do?method=abateMeterData";
		var currentId = window.frames("meterDataFrame").currentId
		var param = "meterDataId=" + currentId;
		new Ajax.Request(url,{method: 'post',parameters: param,onComplete:function(result){
				ajaxSubmitException(result.responseText);
				reloadFrame();
		}});
	}
	/**
	 *  打开导入文件
	 */
	function openImport(){
		var url = "${ctx}/charge_meterDataRegisterAction.do?method=initImport";
		top.windowOpen(url, "import", "${key.charge_meterData_import}", 165, 400,true,"importFrame");
	}
	/**
	 * 导出文件
	 */
	function openExport(){
		var url = "${ctx}/charge_meterDataRegisterAction.do?method=initExport";
		top.windowOpen(url, "export", "${key.charge_meterData_export}", 200, 450,true,"exportFrame");
	}
/**************end********************/
	//刷新列表
	function reloadFrame(){
		window.frames("meterDataFrame").location.href = "${ctx}/charge_meterDataRegisterAction.do?method=list";
	}
	//刷新列表前 情况查询条件
	function reloadFramWithoutCondition(){
		var url = "${ctx}/charge_meterDataRegisterAction.do?method=setSearchVO";
		new Ajax.Request(url,{method: 'post', parameters: null, onComplete: reloadFrame});
	}
	function init(){
		var statuzSelect = document.getElementById("statuz");
		statuzSelect.options[0].value = "";
		for(var i = 1; i < statuzSelect.options.length; i++){
			statuzSelect.options[i].value = statuzSelect.options[i].code;
		}
	}
</script>

</head>
<body onload="init();">
<div style="width"></div>
<div class="pageNav_bg">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td id="pageNav_leftimg">
      	<img src="${ctx}/images/ico_kj_sjlr.gif" width="46" height="47" align="right"/>
      </td>
      <td id="navWord"><span class="page_title">${key.charge_meterData}</span></td>
		<td class="pageNav_right">
			<a href="#" style="CURSOR: hand;" onFocus="this.blur()" onClick="showCycleForward()">
				<img src="${ctx}/images/charage_buzhou.gif" border="0">
			</a>&nbsp;&nbsp;
			<a href="javascript:showFull_in();">
				<img id="full_image"  src="${ctx}/images/ico_fullscreen.gif" border="0"/>
			</a>
		</td>
    </tr>
  </table>
</div>

<div class="container">
  <table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
      <td class="bg_search2">
      	<form id="serchForm" action="" class="required-validate">
      		<table border="0" cellpadding="0" cellspacing="1" class="tab_search2"   >
                      <tr>
                        <td class="td_search">${key.charge_meterData_building}：</td>
                        <td class="td_search">
                        	<pms:unitedSelect
                        		name="buildingId"
                        		optionLabel="name"
                        		optionValue="keyword"
                        		selectText="请选择"
                        		dataList="${buildList}"
                        		style="width:110px;">
                        	</pms:unitedSelect>
                        </td>
                        <td class="td_search">${key.charge_meterData_house}：</td>
                        <td class="td_search">
                          <table border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td ><input name="houseNumber" type="text" class="inputtext" size="16"></td>
                              <td width="25">&nbsp;</td>
                            </tr>
                          </table>
                        </td>
                        <td class="td_search"><span class="grid align_left">${key.charge_meterData_meterType}：</span></td>
                        <td class="td_search">
							<pms:unitedSelect
								name="meterId"
                        		optionLabel="name"
                        		optionValue="keyword"
                        		selectText="${key.select}"
                        		dataList="${meterTypeList}"
                        		style="width:110px;"
							>
							</pms:unitedSelect>
                        </td>
                        <td class="td_search">&nbsp;</td>
                      </tr>
                      <tr>
                        <td  class="grid align_left">${key.charge_meterData_recordTime}：</td>
                        <td class="td_search">
                        	<table border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td><input name="recordTime" type="text" class="inputtext validate-date-yyyy-mm-dd" afterInsert="recordTimeImgButton" value="" size="16"></td>
                              <td width="4">&nbsp;</td>
                              <td width="50"><img id="recordTimeImgButton" src="${ctx}/images/ico_date.gif" width="20" height="20"></td>
                            </tr>
                        </table></td>
                        <td class="td_search" >${key.charge_meterData_statuz}：</td>
                        <td class="td_search">
	                          <mypms:Sysrefcode
	                          		name="statuz"
	                          		id="statuz"
	                          		code="FEE_CHARGE_DATAS_DATA_STATUS"
	                          		showTip="true"
	                          		filterStr="001,002,005"
	                          		style="width:110px;">
	                          </mypms:Sysrefcode>
                        </td>
                        <td class="td_search" ><span class="grid align_left">${key.charge_meterData_periodId}：</span></td>
                        <td class="td_search">
							<pms:unitedSelect
								name="periodId"
                        		optionLabel="period"
                        		optionValue="keyword"
                        		selectText="${key.select}"
                        		dataList="${periodList}"
                        		style="width:110px;"
							>
							</pms:unitedSelect>
                        </td>
                        <td class="td_search" >&nbsp;</td>
                        <td class="td_search">&nbsp;</td>
                        <td class="td_search">
                        	<table border="0" cellpadding="0" cellspacing="0" >
	                            <tr>
	                              <td class="buttonOffLeft" id="btn1_11"></td>
	                              <td class="buttonOffMiddle" id="btn1_12" onclick="mysubmit();" onblur="btn_change(1)" onMouseOver="btn_change_over(1)" onMouseOut="btn_change_out(1)">
	                              	<img src="${ctx}/images/ico_searchico.gif" alt="" border="0" align="absmiddle" />
	                              	${key.search}
	                              </td>
	                              <td class="buttonOffRight" id="btn1_13"></td>
	                            </tr>
                        	</table>
                        </td>
                      </tr>
                  </table>
                  </form>
                  </td>
    </tr>
    <tr>
      <td >
          <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="bg_toolBar">
	              <table width="100%" border="0" cellspacing="0" cellpadding="0">
	                <tr>
	                  <td width="40%">&nbsp;</td>
	                  <td width="60%" align="right">
	                <table border="0" cellpadding="0" cellspacing="0" id="ico1" >
	                  <tr>
	                  <pms:AuthTag authName="charge_meterDataRegisterAction.do?method=initByUser">
	                    <td class="toolbarico">
	                    	<a href="#" onFocus="this.blur()" onClick="openRecordByUser();">
	                    		<img src="${ctx}/images/charge_sjlr_ahlr.gif" border="0" align="absbottom" alt="${key.charge_meterData_menu_byUser}"/>&nbsp;${key.charge_meterData_menu_byUser}
	                    	</a>
	                    </td>
	                   </pms:AuthTag>
                      <pms:AuthTag authName="menu.nopage.meterEnterData">
						<td class="toolbarico">
							<a href="javascript:;"  onClick="showmenulist('quick_menumore',this)" onMouseOut="hidden2menu('quick_menumore')" onFocus="this.blur()">
								<img src="${ctx}/images/charge_sjlr_ablr.gif" alt="${key.charge_meterData_menu_byTable}" width="16" height="16" border="0" align="absbottom"/>&nbsp;${key.charge_meterData_menu_byTable}<img src="${ctx}/images/img_nav_third.gif" alt="更多按表录入" width="6" height="3" border="0" align="absbottom"/>
							</a>
						</td>
					   </pms:AuthTag>

						<pms:AuthTag authName="charge_meterDataRegisterAction.do?method=checkImportExcelFile">
						<td class="toolbar_line">|</td>
						<td class="toolbarico">
						 	<a href="#"  onclick="openImport();"onfocus="this.blur()">
						 		<img src="${ctx}/images/ico_excel_ru.gif" border="0" align="absbottom" alt="${key.charge_meterData_import}"/>&nbsp;${key.charge_meterData_import}
						 	</a>
						</td>
						</pms:AuthTag>
						<pms:AuthTag authName="charge_meterDataRegisterAction.do?method=exportFile">
	                    <td class="toolbarico">
	                    	<a href="#"onclick="openExport();"onfocus="this.blur()">
	                    		<img src="${ctx}/images/ico_excel.gif" alt="${key.charge_meterData_export}"  border="0" align="absbottom" />&nbsp;${key.charge_meterData_export}
	                    	</a>
	                    </td>
	                    </pms:AuthTag>
	                  </tr>
	                </table>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td valign="top">
				<iframe id="meterDataFrame" src="${ctx}/charge_meterDataRegisterAction.do?method=initList"  width="100%" frameborder="0"></iframe>
              </td>
            </tr>
          </table>

    </tr>
  </table>
</div>
<!--------------------右键菜单 开始---------------------->
<div id="quick_rightmenu" style="display:none;" oncontextmenu="return false" class="quick_rightmenu" onMouseOver="MM_showHideLayers('quick_rightmenu','','show')" onMouseOut="MM_showHideLayers('quick_rightmenu','','hidden')">
<table width="100%" border="0" cellpadding="1" cellspacing="0" class="grid_quickMenu_bg">

	<tr>
      <td><table width="100%" border="0" cellpadding="2" cellspacing="0">
      <pms:AuthTag authName="charge_meterDataRegisterAction.do?method=initByUser">
       <tr>
		 <td class="quickMenu_toolbarico">
		 	<a href="#"  onclick="" onFocus="this.blur()">
		 		<img src="${ctx}/images/charge_sjlr_ahlr.gif" border="0" align="absbottom" alt=" "/>&nbsp;${key.charge_meterData_menu_byUser}
		 	</a>
		 </td>
		  </tr>
		  </pms:AuthTag>
		  <pms:AuthTag authName="menu.nopage.meterEnterData">
          <tr>
          <td class="quickMenu_toolbarico">
          	<a href="#" onMouseOver="show2menu('quick_righ2tmenu',this)" onMouseOut="hidden2menu('quick_righ2tmenu')" onFocus="this.blur()">
          		<img src="${ctx}/images/charge_sjlr_ablr.gif" alt="" width="16" height="16" border="0" align="absbottom">&nbsp;${key.charge_meterData_menu_byTable}
          		<img src="${ctx}/images/ico_index_start1.gif" border="0" /></a></td>
          </tr>
          </pms:AuthTag>
      </table></td>
    </tr>
  </table>
</div>
<!--------------------右键二级更多菜单 开始---------------------->
<div id="quick_righ2tmenu" class="quick_menu2" style="display:none;">
  <table width="100%" border="0" cellpadding="1" cellspacing="0" class="grid_quickMenu_bg" onMouseOver="showmy2menu('quick_righ2tmenu')" onMouseOut="hidden2menu('quick_righ2tmenu')">
       <tr>
      <td>
	  <table width="100%" border="0" cellpadding="2" cellspacing="0">
	    <pms:AuthTag authName="charge_meterDataRegisterAction.do?method=initByWater">
	    <tr>
         <td class="quickMenu_toolbarico">
         	<a href="#" onClick="openRecordBySaterMeter();" onFocus="this.blur()">
         		<img src="${ctx}/images/charge_sjlr_asblr.gif" alt="${key.charge_meterData_menu_byWater}" border="0" align="absbottom"/>&nbsp;${key.charge_meterData_menu_byWater}
         	</a>
         </td>
          </tr>
          </pms:AuthTag>
      <pms:AuthTag authName="charge_meterDataRegisterAction.do?method=initByAmmeter">
        <tr>
         <td class="quickMenu_toolbarico">
         	<a href="#" onFocus="this.blur()" onClick="">
         		<img src="${ctx}/images/charge_sjlr_adblr.gif" alt="${key.charge_meterData_menu_byAmmeter}" border="0" align="absbottom"/>&nbsp;${key.charge_meterData_menu_byAmmeter}
         	</a>
         </td>
          </tr>
     </pms:AuthTag>
      </table></td>
    </tr>
  </table>
</div>
<!--------------------右边图标二级更多菜单 开始---------------------->
<div id="quick_menumore" class="quick_menu2" >
  <table width="100%" border="0" cellpadding="1" cellspacing="0" class="grid_quickMenu_bg" onMouseOver="showmy2menu('quick_menumore')" onMouseOut="hidden2menu('quick_menumore')">
       <tr>
      <td>
	  <table width="100%" border="0" cellpadding="1" cellspacing="0">
	    <tr>
        <td class="quickMenu_toolbarico">
        	<a href="#" onClick="openRecordBySaterMeter();" onFocus="this.blur()">
        		<img src="${ctx}/images/charge_sjlr_asblr.gif" alt="${key.charge_meterData_menu_byWater}" border="0" align="absbottom"/>&nbsp;${key.charge_meterData_menu_byWater}
        	</a>
        </td>
          </tr>
        <tr>
        <td class="quickMenu_toolbarico">
        	<a href="#" onFocus="this.blur()" onClick="openRecordByAmmeter();">
        		<img src="${ctx}/images/charge_sjlr_adblr.gif" alt="${key.charge_meterData_menu_byAmmeter}" border="0" align="absbottom"/>&nbsp;${key.charge_meterData_menu_byAmmeter}
        	</a>
        </td>
          </tr>
      </table></td>
    </tr>
  </table>
</div>
<script type="text/javascript">
              Calendar.setup(
              {
	              inputField : "recordTime", // ID of the input field
	              ifFormat : "%Y-%m-%d", // the date format
	              button : "recordTimeImgButton", // ID of the button
	              align          :    "Tl",           // alignment (defaults to "Bl")
			      singleClick    :    true
              }
              );

</script>
</body>
</html>
